<script setup>
import {useRoute, useRouter} from 'vue-router';

const route = useRoute();
const router = useRouter();

function getInfo() {
  console.log("route: ", route);
  console.log("route.params: ", route.params);
  console.log("route.name: ", route.name);
  console.log("route.path: ", route.path);
}

function goHome() {
  router.push("/");
}

function back() {
  // router.go(-1);
  router.back();
}

function forward() {
  // router.go(1);
  router.forward();
}
</script>

<template>
<div>
  <h3>个人详情</h3>
  <button @click="getInfo">获取页面信息</button>
  <button @click="goHome">跳到首页</button>
  <button @click="back">回退</button>
  <button @click="forward">前进</button>
</div>
</template>

<style scoped>

</style>